package com.alibaba.citrus.cr.sales.plan.functions.salesplan;

import com.alibaba.citrus.cr.common.util.SpringContextUtil;
import com.alibaba.citrus.cr.sales.plan.repository.SalesPlanScItemStatRepository;
import com.alibaba.citrus.cr.sales.plan.sdo.SalesPlanStatScItemSDO;
import lombok.Getter;
import lombok.Setter;

/**
 * @author yuhailin
 * @description:
 * @date 2021-09-27 10:44
 */
public class SalesPlanScItemStatEntity {
    @Getter
    @Setter
    private SalesPlanStatScItemSDO salesPlanScItemStatSDO;

    private static SalesPlanScItemStatRepository salesPlanScItemStatRepository;

    static {
        salesPlanScItemStatRepository = SpringContextUtil.getBean(SalesPlanScItemStatRepository.class);
    }

    public static SalesPlanScItemStatEntity of(SalesPlanStatScItemSDO salesPlanScItemStatSDO) {
        SalesPlanScItemStatEntity entity = new SalesPlanScItemStatEntity();
        entity.setSalesPlanScItemStatSDO(salesPlanScItemStatSDO);
        return entity;
    }

    public Boolean updateSalesPlanScItemStatus(){
        return salesPlanScItemStatRepository.updateSalesPlanScItemStatus(this.salesPlanScItemStatSDO);
    }

    public Boolean editSalesPlanScItem(){
        return salesPlanScItemStatRepository.editSalesPlanScItem(this.salesPlanScItemStatSDO);
    }
}
